package uplb.ics.cs190.e2d.core;

import java.io.InputStream;

import uplb.ics.cs190.e2d.display.Graphics;
import uplb.ics.cs190.e2d.graphics.Image;
import uplb.ics.cs190.e2d.io.File;
import uplb.ics.cs190.e2d.math.Dimension;

public abstract class Game {

	private Engine engine;
	
	protected void setEngine(Engine engine) {
		this.engine = engine;
	}
	
	public abstract String getTitle();

	public abstract Image getIcon();

	public abstract Dimension getSize();

	public void loadResources() {
		this.initResources();
	}

	public abstract void initResources();

	public abstract void destroy();

	public abstract boolean isFullScreen();

	public abstract boolean useBufferStrategy();
	
	public abstract boolean useVsync();
	
	public abstract boolean isOpenGL();

	public abstract void render(Graphics g);
	
	public abstract void update(long elapsedTime);

	/* FILE IO */
	public Image getImage(String path) {
		return engine.getImage(path);
	}
	
	public File getFile(String path) {
		return engine.getFile(path);
	}
	
	public InputStream getInputStream(String path) {
		return engine.getInputStream(path);
	}
}
